<!-- <template v-if="show">
  <div>


    <div id="aaaa" class="container1" :style="'height:' + divHeight"></div>



  </div>
</template>

<script>
  import AMapLoader from "@amap/amap-jsapi-loader";
  window._AMapSecurityConfig = {
    // 安全密钥
    securityJsCode: "8edcf123e71969d233dca5a9b13657f0",
  };
  export default {
    name: "TestIndex",
    props: {
      divHeight: {
        type: String,
        default: '600px'
      }
    },
    data() {
      return {
        // 地图实例
        map1: null,
        // 标记点
        marker: "",
        show: true,
        // 地址逆解析
        geoCoder: null,
        // 搜索提示
        AutoComplete: null,
        // 搜索关键字
        keywords: "",
        // 位置信息
        form: {
          lng: 0,
          lat: 0,
          address: "",
          adcode: "", //地区编码
          addressName: ""
        },
        // 搜索节流阀
        loading: false,
        // 搜索提示信息
        options: [],
        geocoder: null
      };
    },
    methods: {
      initMap(param) {
        AMapLoader.load({
            // 你申请的Key
            key: "55f2ff51aeca19a345dead256aae7b19",
            // key: "27a92ead602037ed55f620e495c0f78c",
            version: "2.0",
            // 需要用到的插件
            plugins: ["AMap.Geocoder", "AMap.AutoComplete"],
          })
          .then((AMap) => {
            this.map1 = new AMap.Map("aaaa", {
              viewMode: "3D", //是否为3D地图模式
              zoom: 16, //初始化地图级别
              center: [param.lng, param.lat], //初始化地图中心点位置
              dragEnable: false, // 禁用拖动
              zoomEnable: false, // 禁用缩放
              mapStyle: "amap://styles/darkblue"
            });

            this.map1.setFeatures(["road", "building"]); // 设置显示的元素

            this.form = param
            //地址逆解析插件
            this.geoCoder = new AMap.Geocoder({
              city: "010", //城市设为北京，默认：“全国”
              radius: 1000, //范围，默认：500
            });

            // 搜索提示插件
            this.AutoComplete = new AMap.AutoComplete({
              city: "全国"
            });
          })
          .catch((err) => {
            // 错误
            console.log(err);
          });
      }
    },
    mounted() {
      // this.initMap();
    },
  };
</script>

<style>
  .container1 {
    width: 100%;
  }
</style>
 -->